// 配置路由
import { createRouter, createWebHashHistory } from "vue-router";

import Account from "../views/account/index.vue";
import Category from "../views/category/index.vue";
import Product from "../views/product/index.vue";
import { GoodsFilled, Grid, StarFilled, UserFilled } from "@element-plus/icons-vue";
import StarManager from "../views/StarManager.vue";

// 配置路径--组件之间的映射关系
export const routes = [
  {
    path: "/account",
    component: Account,
    meta: { title: "账号管理", icon: UserFilled },
  },
  {
    path: "/category",
    component: Category,
    meta: { title: "分类管理", icon: Grid },
  },
  {
    path: "/star",
    component: StarManager,
    meta: { title: "明星管理", icon: StarFilled },
  },
  {
    path: "/prod",
    component: Product,
    meta: { title: "商品管理", icon: GoodsFilled },
  },
];

//定义路由对象
const router = createRouter({
  history: createWebHashHistory(), //设定路由模式，此处启用hash模式
  routes: routes,
});

export default router;
